//package com.wxzz.elearing.user.api.app;
//
//import com.wxzz.elearing.user.dto.WxLoginDto;
//import com.wxzz.elearning.common.utils.MD5Util;
//import com.wxzz.elearning.common.vo.ReturnVO;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.time.LocalDateTime;
//import java.time.ZoneOffset;
//import java.util.HashMap;
//import java.util.Map;
//import java.util.UUID;
//
//@RestController
//@RequestMapping("/wx-im")
//@Api(tags = "IM聊天")
//public class WxIMController {
//
//    String appkey = "90404644792112144baf94ae";
//    String masterSecret = "246eed9ae3f94a648afad942";
//
//
//    @ApiOperation(value = "IM初始化", notes = "IM初始化", httpMethod = "POST", tags = "小程序")
//    @RequestMapping(value = "initIM", method = RequestMethod.POST)
//    public ReturnVO<Map> initIM() {
//        Map<String, String> map = new HashMap<>();
//        String uuid = UUID.randomUUID().toString();
//        String time = String.valueOf(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli());
//        map.put("appkey", appkey);
//        map.put("random_str", uuid);
//        map.put("signature", MD5Util.md5Encrypt32Upper("appkey=90404644792112144baf94ae&timestamp=" + time + "&random_str=" + uuid + "&key=" + masterSecret));
//        map.put("timestamp", time);
//        return new ReturnVO<>("IM初始化参数",map);
//    }
//}
